<div class="box">
    <div class="heading">
        <h1><img alt="" src="<?php echo base_url('assets/admin/images/category.png'); ?>">Add Gallery</h1>

        <div class="buttons">
            <a class="button" href="#" onClick="$('#form').submit();"><span>Save</span></a>
            <a class="button" href="<?php echo base_url(ADMIN_PATH . '/gallery'); ?>"><span>Cancel</span></a>
        </div>
    </div>
    <div class="content">

        <?php echo form_open(null, 'id="form"')?>

        <div class="form">
            <div>
                <?php echo form_label('Gallery Name:', 'title')?>
                <?php echo form_input(array('name' => 'title', 'id'=>'title', 'value' => set_value('title', '')))?>
            </div>
			<div>
                <?php echo form_label('Gallery Short Name:', 'title')?>
                <?php echo form_input(array('name' => 'short_name','id'=>'short_name', 'value' => set_value('short_name', '')))?>
            </div>
        </div>

        <div class="clear"></div>

        <?php echo form_close(); ?>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function() {
		// Auto Generate Url Title
		$('#title').keyup( function(e) {
			$('#short_name').val($(this).val().toLowerCase().replace(/\s+/g, '_').replace(/[^a-z0-9\-_]/g, ''))
		});
	});
</script>